<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
            h1{
                background: palevioletred;
                color: aquamarine;
            }
            </style>
</head>
<body>
        <textarea name="" id="txt" cols="30" rows="10"></textarea>
        <button id="btn">按钮</button>
        <p>哈哈哈哈</p>
        <script>
                var btn=document.getElementById('btn');
                var txt=document.getElementById('txt');
                btn.onclick=function(){
                    this.parentNode.removeChild(this)
                }
                </script>
</body>
</html>